#!/bin/bash 

ARR=(6 8 4 1 5 9 7 2 10 3)
len=${#ARR[@]}

for((i=0;i<$((len-1));i++))
do
	for((j=0;j<$((len-1-i));j++))
	do
		if [ ${ARR[j]} -gt ${ARR[$((j+1))]} ]
		then
			temp=${ARR[j]}
			ARR[j]=${ARR[$((j+1))]}
			ARR[$((j+1))]=$temp
		fi
	done
done

# 输出
for i in ${ARR[@]}
do
	echo -n "$i "
done
echo ""
